# coding:utf-8
from odoo import models, fields, api, _
from odoo.exceptions import Warning


class ZfyLocationCheck(models.Model):
    _inherit = 'stock.picking'

    @api.constrains('location_id', 'location_dest_id')
    def _constrains_constrains(self):
        if self.location_id == self.location_dest_id:
            raise Warning(_(u'源位置区域与目的位置区域不能相同！'))
